package com.androidhive.jsonparsing;

import java.io.ObjectOutputStream.PutField;
import java.util.ArrayList;
import java.util.HashMap;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.Log;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.TabHost.TabSpec;
import android.widget.Adapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewSwitcher;


import com.vg.config.linkUrl;
import com.vg.leftmenu.Tao_Album;
import com.vg.leftmenu.banbe;
import com.vg.leftmenu.chinhsuathongtin;
import com.vg.leftmenu.contact;
import com.vg.leftmenu.danhsachbanbe;
import com.vg.leftmenu.timban;
import com.vg.library.Httppostaux;
import com.vg.loadimage.ImageLoader;
import com.vg.login.Login;
import com.vg.service.ServiceBody;
import com.vg.service.ServiceCity;
import com.vg.service.ServiceGender;
import com.vg.service.ServiceMaritalStatus;
import com.vg.service.ServiceUserType;
import com.vg.service.service_loadjson;
import com.vg.spinner.City;
import com.vg.spinner.QuickActionGender;
import com.vg.spinner.QuickActionKhongRoTinhTrang;
import com.vg.spinner.QuickActionNoiSong;
import com.vg.spinner.QuickActionTinhTrangHonNhan;
import com.vg.spinner.Student;
import com.vg.tab.test;
import com.vg.tab.user_info;


public class Activity_ChatIndex extends TabActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		getWindow().setSoftInputMode(
				WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
		setContentView(R.layout.activity_chat_tab);
		setTabs();
	}
	
	private void setTabs()
	{
		addTab("Home", R.drawable.icon_config_tab1, ActivityMessages.class);
		addTab("Bạn Bè", R.drawable.icon_config_tab2, contact.class);
		
		addTab("Mở Rộng", R.drawable.icon_config_tab3, user_info.class);
		addTab("Cá Nhân", R.drawable.icon_config_tab4, test.class);
	}
	
	private void addTab(String labelId, int drawableId, Class<?> c)
	{
		TabHost tabHost = getTabHost();
		Intent intent = new Intent(this, c);
		TabHost.TabSpec spec = tabHost.newTabSpec("tab" + labelId);	
		
		View tabIndicator = LayoutInflater.from(this).inflate(R.layout.tab_indicator, getTabWidget(), false);
		TextView title = (TextView) tabIndicator.findViewById(R.id.title);
		title.setText(labelId);
		ImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);
		icon.setImageResource(drawableId);
		
		spec.setIndicator(tabIndicator);
		spec.setContent(intent);
		tabHost.addTab(spec);
	}
}
